define([
    'jQuery',
    'Underscore',
    'Backbone',
    'Kendo',
    'i18n!nls/language',
    'models/qualification',
    'datasources/qualification'
], function($, _, Backbone, Kendo, i18n, Qualification, qualificationDatasource) {

    
    
    var qualificationTabView = kendo.observable({
    
        
        
        createOverviewTable: function() {
            
            // create the grind containing the update elements
            $("#qualification_grid").kendoGrid({
                dataSource: qualificationDatasource,
                columns: [{
                        field: "id",
                        title: i18n.qualification.grid.column.id,
                        width: 80,
                    }, { 
                        field: "name",
                        title: i18n.qualification.grid.column.name, 
                    }, { 
                        field: "description",
                        title: i18n.qualification.grid.column.description, 
                    }, { 
                        field: "scoremin",
                        title: i18n.qualification.grid.column.scoremin, 
                    }, { 
                        field: "scoremax",
                        title: i18n.qualification.grid.column.scoremax, 
                    }],
                toolbar: [{ 
                        name: "create",
                        text: i18n.grid.button.create,
                    }, {
                        name: "save",
                        text: i18n.grid.button.save,
                    }, { 
                        name : "cancel",
                        text: i18n.grid.button.cancel,
                    }],
                sortable: true,
                pageable: {
                    input: true,
                    refresh: true,
                    pageSizes: [5,10,20,50,100],
                    messages: i18n.grid.message
                },
                sortable: {
                    mode: "multiple",
                    allowUnsort: true
                },
                editable: true
            });
            
        },
        

        
        renderSubviews: function() {
            
            this.createOverviewTable();
            
        },
        
        
        
        // self executing function acts like a constructor (hence the name)
        __construct: (function(self, window, undefined) {
            
            // do nothing right now...
// console.log('treespecieTabView initialized!');
            
        })(this, window)
        

    
    });

    
    
    return qualificationTabView;
    
    
    
});